//
//  LKChoosePKTypeViewController.m
//  YLHelper
//
//  Created by she1323 on 2018/5/18.
//  Copyright © 2018年 she1323. All rights reserved.
//

#import "LKChoosePKTypeViewController.h"
#import "LKDayInforPersonEditCell.h"
#import "LKChoosePKPeopleViewController.h"
@interface LKChoosePKTypeViewController ()<UITableViewDelegate,UITableViewDataSource,UINavigationControllerDelegate>
@property(nonatomic,strong)LKBaseTableview *tableview;
@property(nonatomic,strong)NSArray *titlesArray;
@end

@implementation LKChoosePKTypeViewController
-(LKBaseTableview *)tableview{
    if (!_tableview) {
        _tableview = [LKBaseTableview setTableviewWithFrame:CGRectMake(0, NAVIGATION_BAR_HEIGHT, WIDTH, HEIGHT - NAVIGATION_BAR_HEIGHT) style:UITableViewStylePlain registercellClasss:@[@"LKDayInforPersonEditCell"]];
        [self.view addSubview:_tableview];
        _tableview.delegate = self;
        _tableview.dataSource = self;
        _tableview.separatorStyle = UITableViewCellSelectionStyleNone;
        _tableview.tableFooterView = [[UIView alloc] init];
    }
    return _tableview;
}

- (void)viewDidLoad {
    [super viewDidLoad];
    self.tableview.estimatedRowHeight = 200;
    // Do any additional setup after loading the view.
}
-(void)setNavgationBackBtn{
    [super setNavgationBackBtn];
    self.navigationItem.title = @"选择类型";
    [self.backButton setTitleColor:[UIColor whiteColor]];
    [self.backButton setImage:[UIImage imageNamed:@"back2"] forState:UIControlStateNormal];
}
-(void)viewWillAppear:(BOOL)animated{
    [super viewWillAppear:animated];
    [self.navigationController.navigationBar setBarTintColor:blueDefault];
    //设置导航条文字颜色 白色
    [self.navigationController.navigationBar setTitleTextAttributes:@{NSForegroundColorAttributeName:[UIColor whiteColor]}];
    self.navigationController.delegate = self;
}

-(void)viewWillDisappear:(BOOL)animated{
    [super viewWillDisappear:animated];
    [self.navigationController.navigationBar setBarTintColor:[UIColor whiteColor]];
    //设置导航条文字颜色 白色
    [self.navigationController.navigationBar setTitleTextAttributes:@{NSForegroundColorAttributeName:COLOR_HEX(0x000000)}];
    
}
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    return self.titlesArray.count;
}
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    LKDayInforPersonEditCell *cell = [tableView dequeueReusableCellWithIdentifier:@"LKDayInforPersonEditCell"];
    cell.titleLabel.textColor = COLOR_HEX(0x474747);
    cell.titleLabel.text = self.titlesArray[indexPath.row];
    cell.contentLabel.hidden = YES;
    return cell;
}
-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
    return 50;
}
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
    LKChoosePKPeopleViewController *vc = [[LKChoosePKPeopleViewController alloc] init];
    [self.navigationController pushViewController:vc animated:YES];
}
-(NSArray *)titlesArray{
    if (!_titlesArray) {
        _titlesArray = @[@"主管团队PK",@"个人PK"];
    }
    return _titlesArray;
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
